﻿<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
	<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
	<meta http-equiv="Pragma" content="no-cache" />
	<meta http-equiv="Expires" content="0" />
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="/lib/html5shiv.js"></script>
<script type="text/javascript" src="/lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="/static/h-ui.admin/css/style.css" />
	<link rel="stylesheet" href="/layui.css" media="all">
<!--[if IE 6]>
<script type="text/javascript" src="/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>订阅列表</title>
	<style type="text/css" media="screen">
		a {
			color: #2B4A78;
			text-decoration: none;
		}

		a:hover {
			color: #2B4A78;
			text-decoration: underline;
		}

		a:focus, input:focus {
			outline-style: none;
			outline-width: medium;
		}

		/* custom css style: pageNum,cPageNum */
		.pageNum {
			border: 1px solid #999;
			padding: 2px 8px;
			display: inline-block;
		}

		.cPageNum {
			font-weight: bold;
			padding: 2px 5px;
		}
		#pageNav{
			-moz-user-select: none;
			-webkit-user-select: none;
			-ms-user-select: none;
		}
		#pageNav a:hover {
			text-decoration: none;
			background: #fff4d8;
		}

	</style>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 订阅管理 </nav>
<div class="page-container">
	<div class="cl pd-5 bg-1 bk-gray mt-20" style="padding: 27px 5px 5px 5px;">
		<div  style=" margin:auto; width:380px; ">
			<form class="layui-form layui-form-pane" action="/querySubscribeByUname" style="height: 38px;">
				<div style="float: left">
					<label class="layui-form-label">用户名</label>
					<div class="layui-input-inline">
						<input type="text" name="uname" id="uname"  lay-verify="required" placeholder="请输入你要查询的用户" autocomplete="off" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item"  style="float:left;clear: none;margin-bottom:0">
					<div id="button_relative">
						<button class="layui-btn" lay-submit lay-filter="aa">查询</button>
					</div>
				</div>
			</form>
		</div>
		<div style="height: 22px; text-align: right;">共有数据：<strong th:text="${total}"></strong> 条</div>
	</div>
	<div class="mt-20">

		<table id="tab" class="table table-border table-bordered table-bg table-hover  table-responsive">
			<thead>
				<tr class="text-c">
					<th>ID</th>
					<th >用户名</th>
					<th>订阅栏目</th>
					<th>订阅时间</th>
					<th >模型名称</th>
				</tr>
			</thead>
			<tbody id="tbody">

				<!--<tr th:each="subscribeModel:${subscribeModelList}" class="text-c">-->
					<!--<td  th:text="${subscribeModel.sub_id}"></td>-->
					<!--<td  th:text="${subscribeModel.user.uname}"></td>-->
					<!--<td  th:text="${subscribeModel.program.program_name}"></td>-->
					<!--<td  th:switch="${subscribeModel.program.program_id}">-->
						<!--<span  th:case="1" th:text="${subscribeModel.coin.cname}"></span>-->
						<!--<span th:case="2" th:text="${subscribeModel.exchange.ename}"></span>-->
						<!--<span  th:case="3" >暂无模型</span>-->
					<!--</td>-->
				<!--</tr>-->
			</tbody>
		</table>
		<script type="text/javascript" src="/pagenav1.1.cn.js"></script>
		<script type="text/javascript" src="/jquery.js"></script>
		<script th:inline="javascript" type="text/javascript">

            //$(function(){ //for jquery
            window.onload = (function(){

                //optional set
                pageNav.pre="上一页";
                pageNav.next="下一页";


                //  p,当前页码,pn,总页面
                pageNav.fn = function(p,pn){
                    // document.getElementById("test").innerHTML ="当前页:"+p+"  ,  总页: "+pn;
                    //$("#test").text("Page:"+p+" of "+pn + " pages."); // jquery调用方式
					//alert(p);
                    $.post("/querySubscribeByPage1", {

                        start: (p-1)*20,
						limit:20
						},
                        function (data) {
                            var tbody=$("#tbody");
                            tbody.html("");
                            var trData="";

                            $.each(data, function (i, item) {
                                //$("<img class='para'/> ").attr("src", item.media.m).appendTo("#resText");
                                 trData += "<tr><td style='text-align: center'>"+ item.sub_id +"</td><td style='text-align: center'>"+ item.user.uname +"</td><td style='text-align: center'>"+ item.program.program_name +"</td><td style='text-align: center'>"+ item.formatTime +"</td><td>"
								 if(item.coin!=null){
                                     trData+="<span>";
                                     trData+=item.coin.cname+"</span>"
								}
								if(item.exchange!=null){

                                    trData+="<span>";
                                    trData+=item.exchange.ename+"</span></td></tr>"
                                }else {
                                     trData+="</td></tr>"
								 }
								 if(item.coin==null & item.exchange==null){
                                     trData+="暂无模型</td></tr>"
								 }

                            });
							tbody.append(trData);
                        });


                };

                //每页数显示条数固定10条
                pageNav.go(1,[[${totalPage}]] );
            });
		</script>
		<!--<div id="test" style="height:70px;padding:30px 10px;font-size: 300%;"></div>-->

		<div style="float: right" id="pageNav"></div>
	</div>
</div>
<script type="text/javascript" src="/layui.all.js"></script>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="/static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="/my.js"></script>

<script type="text/javascript">
    // 添加跳出新窗口
    function classifiedPacket_add(title,url,w,h){
        layer_show(title,url,w,h);
    }
    function classifiedPacket_update(title,url,w,h){
        layer_show(title,url,w,h);


    }
    function tamp(title,url,w,h,program_id){
        var u=url+"?program_id="+program_id
        classifiedPacket_add(title,u,w,h)



    }
     //删除确认提示
    function deleteById(program_id){
        layer.confirm("确认要删除吗", { title: "删除确认" }, function (index) {
            layer.close(index);
            $.post("/deleteProgramById", {program_id: program_id},
                function (data) {
                var datares=eval(data)
                        layer.alert(datares.msg, {
                                title: "删除操作",
                                btn: ['确定']
                            },
                            function (index, item) {
                                //layer.close(index);
                                location.reload();
                            });
                });

        });
    }

</script>
</body>
</html>